Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for namespace::function() calls #121

Merged
merged 3 commits into from
Jul 15, 2024
Merged

Conversation

radbasa
Copy link
Collaborator

@radbasa radbasa commented Jul 12, 2024

Closes #104

Description

  • New linter function to disallow namespace::function() calls
  • Allows by default all box::*()
  • Has an allow parameter to add other namespace and namespace::function names to allow.
  • Uses treesitter to parse the source as a future reference.

Definition of Done

  • The change is thoroughly documented.
  • The CI passes (R CMD check, linter, unit tests, spelling).
  • Any generated files have been updated (e.g. .Rd files with roxygen2::roxygenise())

@radbasa
Copy link
Collaborator Author

radbasa commented Jul 12, 2024

@jakubnowicki Question. Do we add this to both box_default_linters and rhino_default_linters?

@radbasa radbasa requested a review from jakubnowicki July 12, 2024 06:45
Copy link

codecov bot commented Jul 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.05%. Comparing base (1a31217) to head (ea9cf50).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #121      +/-   ##
==========================================
+ Coverage   97.99%   98.05%   +0.06%     
==========================================
  Files          22       23       +1     
  Lines        1046     1081      +35     
==========================================
+ Hits         1025     1060      +35     
  Misses         21       21              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@jakubnowicki jakubnowicki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@radbasa radbasa merged commit e998ea5 into main Jul 15, 2024
5 checks passed
@radbasa radbasa deleted the lint-on-namespace-function branch July 15, 2024 04:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Should lint on package::function pattern
2 participants